<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>箭头函数</title>
    <style>
      div {
        width: 200px;
        height: 200px;
        background-color: pink;
      }
    </style>
  </head>
  <body>
    <div class="ad"></div>
    <script>
      var div = document.querySelector(".ad");
      div.addEventListener("click", () => {
        // console.log(1);
        setTimeout(function () {
          console.log(1);
          div.style.backgroundColor = "blue";
        }, 2000);
      });
    </script>
  </body>
</html>
